#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "dominion.h"

struct gameState* testGame(){
	struct gameState* game = malloc(sizeof(struct gameState));
	return game;
}

int* cardArray = [curse, copper, silver, gold, adventurer, council_room, feast, gardens, mine, remodel, smithy, village, baron, great_hall, minion, steward, tribute, ambassador, cutpurse, embargo, outpost, salvager, sea_hag, treasure_map];

struct testBaron{
	int currentPlayer;
	int choice1;
};

void generateNums(struct testBaron* test, struct gameState* game){
	int i;

	test->currentPlayer = rand() % MAX_PLAYERS;
	test->choice1 = (rand() % 32) - (rand() % 16); //generate values above, below, and equal to 0

	game->coins = rand() % 128;
	game->discardCount[currentPlayer] = rand() % 20;
	game->deckCount[test->currentPlayer] = rand() % MAX_DECK;
	game->deck[test->currentPlayer] = rand() % MAX_DECK;
	game->handCount[test->currentPlayer] = rand() % MAX_HAND;
	for(i = 0; i < game->handCount[test->currentPlayer]; i++){
		game->hand[test->currentPlayer][i] = cardArray[rand() % 24];
	}
}

int main(){
	int i, numtests = 10000;
	struct gameState* game = testGame();	//create testing struct gameState
	struct testBaron* myTest = malloc(sizeof(struct testBaron));
	srand(time(NULL));  		//seed random number generator
	for(i = 0; i < numtests; i++){ 
		generateNums(myTest, game);
		zzzbaroncardplay(game, myTest->currentPlayer, myTest->choice1);
	}
	free(game);
	free(myTest);
	return 0;
}
